home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 52
/
Volume 52 - JOGO DISK .iso
/
Games
/
scoobysnackmachine.swf
/
scripts
/
__Packages
/
WheelRail.as
< prev
Wrap
Text File
|
2007-10-01
|
13KB
|
347 lines
var §\x01§ = 963;
while(true)
{
if(eval("\x01") == 963)
{
set("\x01",eval("\x01") - 678);
§§push(true);
}
else if(eval("\x01") == 511)
{
set("\x01",eval("\x01") - 460);
}
else if(eval("\x01") == 410)
{
set("\x01",eval("\x01") + 386);
}
else
{
if(eval("\x01") == 796)
{
set("\x01",eval("\x01") + 27);
if(!_global.WheelRail)
{
var _loc2_ = _global.WheelRail = function(__mcRef)
{
this.mcRef = __mcRef;
this.nSlowFactor = 1;
this.nAngle = 0;
this.nDistanceMade = 0;
this.nDirection = WheelRail.DIRECTION_LEFT;
this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
this.bSearchingForAffectation = true;
this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
Level.__get__Instance().doAddListener(this);
}.prototype;
_loc2_.setRotation = function(__nAngle)
{
this.nAngle = __nAngle;
this.mcRef._rotation = this.nAngle;
};
_loc2_.setInitialDirection = function(__nDirection)
{
this.nDirection = __nDirection;
};
_loc2_.doEnterFrame = function()
{
if(this.bSearchingForAffectation)
{
if(this.nSearchedTime > 0)
{
this.nSearchedTime = this.nSearchedTime - 1;
this.doSearchWheel();
}
else
{
this.bSearchingForAffectation = false;
}
}
else
{
this.doMoveWheel();
}
};
_loc2_.doDestroy = function()
{
delete this.oWheelAffected;
};
_loc2_.doMoveWheel = function()
{
var _loc2_ = undefined;
if(this.nDirection == WheelRail.DIRECTION_LEFT)
{
_loc2_ = -1;
}
else
{
_loc2_ = 1;
}
var _loc3_ = _loc2_ * WheelRail.MOVE_SPEED;
if(Math.abs(this.nDistanceMade) >= this.nMaxDistance * WheelRail.PERCENT_DIST_MADE_DECEL)
{
if(_loc2_ == Library.Utils.MoreMath.getPolarity(this.nDistanceMade))
{
this.nSlowFactor -= WheelRail.DECEL_ON_EDGES;
if(this.nSlowFactor < WheelRail.MAX_SLOW_FACTOR)
{
this.nSlowFactor = WheelRail.MAX_SLOW_FACTOR;
}
}
else
{
this.nSlowFactor += WheelRail.DECEL_ON_EDGES;
if(this.nSlowFactor > 1)
{
this.nSlowFactor = 1;
}
}
_loc3_ *= this.nSlowFactor;
}
else
{
this.nSlowFactor = 1;
}
this.nDistanceMade += _loc3_;
var _loc4_ = Library.Utils.MoreMath.getRadianFromDegree(this.nAngle);
var _loc5_ = Math.cos(_loc4_) * this.nDistanceMade;
var _loc6_ = Math.sin(_loc4_) * this.nDistanceMade;
this.oWheelAffected.__get__Ref()._x = this.mcRef._x + _loc5_;
this.oWheelAffected.__get__Ref()._y = this.mcRef._y + _loc6_;
if(Math.abs(this.nDistanceMade) > this.nMaxDistance)
{
if(this.nDirection == WheelRail.DIRECTION_LEFT)
{
this.nDirection = WheelRail.DIRECTION_RIGHT;
}
else
{
this.nDirection = WheelRail.DIRECTION_LEFT;
}
}
};
_loc2_.doSearchWheel = function()
{
var _loc3_ = Level.__get__Instance().__get__Objects();
var _loc7_ = this.mcRef._x;
var _loc8_ = this.mcRef._y;
var _loc2_ = 0;
while(_loc2_ <= _loc3_.length - 1)
{
if(_loc3_[_loc2_].ObjectType == Level.OBJECT_TYPE_WHEEL)
{
var _loc5_ = _loc3_[_loc2_].Ref._x;
var _loc6_ = _loc3_[_loc2_].Ref._y;
var _loc4_ = Library.Utils.MoreMath.getDistance(_loc7_,_loc8_,_loc5_,_loc6_);
if(_loc4_ <= WheelRail.AFFECT_DISTANCE_ADDON + Math.max(this.mcRef._width / 2,this.mcRef._height / 2))
{
this.oWheelAffected = _loc3_[_loc2_];
this.oWheelAffected.__get__Ref()._x = this.mcRef._x;
this.oWheelAffected.__get__Ref()._y = this.mcRef._y;
this.doMoveWheel();
this.bSearchingForAffectation = false;
_loc2_ = _loc3_.length;
}
}
_loc2_ = _loc2_ + 1;
}
};
_global.WheelRail = function(__mcRef)
{
this.mcRef = __mcRef;
this.nSlowFactor = 1;
this.nAngle = 0;
this.nDistanceMade = 0;
this.nDirection = WheelRail.DIRECTION_LEFT;
this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
this.bSearchingForAffectation = true;
this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
Level.__get__Instance().doAddListener(this);
}.DIRECTION_LEFT = 1;
_global.WheelRail = function(__mcRef)
{
this.mcRef = __mcRef;
this.nSlowFactor = 1;
this.nAngle = 0;
this.nDistanceMade = 0;
this.nDirection = WheelRail.DIRECTION_LEFT;
this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
this.bSearchingForAffectation = true;
this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
Level.__get__Instance().doAddListener(this);
}.DIRECTION_RIGHT = 2;
_global.WheelRail = function(__mcRef)
{
this.mcRef = __mcRef;
this.nSlowFactor = 1;
this.nAngle = 0;
this.nDistanceMade = 0;
this.nDirection = WheelRail.DIRECTION_LEFT;
this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
this.bSearchingForAffectation = true;
this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
Level.__get__Instance().doAddListener(this);
}.AFFECT_DISTANCE_ADDON = 35;
_global.WheelRail = function(__mcRef)
{
this.mcRef = __mcRef;
this.nSlowFactor = 1;
this.nAngle = 0;
this.nDistanceMade = 0;
this.nDirection = WheelRail.DIRECTION_LEFT;
this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
this.bSearchingForAffectation = true;
this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
Level.__get__Instance().doAddListener(this);
}.SEARCH_MAX_TIME = 2;
_global.WheelRail = function(__mcRef)
{
this.mcRef = __mcRef;
this.nSlowFactor = 1;
this.nAngle = 0;
this.nDistanceMade = 0;
this.nDirection = WheelRail.DIRECTION_LEFT;
this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
this.bSearchingForAffectation = true;
this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
Level.__get__Instance().doAddListener(this);
}.MOVE_SPEED = 1.2;
_global.WheelRail = function(__mcRef)
{
this.mcRef = __mcRef;
this.nSlowFactor = 1;
this.nAngle = 0;
this.nDistanceMade = 0;
this.nDirection = WheelRail.DIRECTION_LEFT;
this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
this.bSearchingForAffectation = true;
this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
Level.__get__Instance().doAddListener(this);
}.EDGE_BUFFER = 10;
_global.WheelRail = function(__mcRef)
{
this.mcRef = __mcRef;
this.nSlowFactor = 1;
this.nAngle = 0;
this.nDistanceMade = 0;
this.nDirection = WheelRail.DIRECTION_LEFT;
this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
this.bSearchingForAffectation = true;
this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
Level.__get__Instance().doAddListener(this);
}.PERCENT_DIST_MADE_DECEL = 0.5;
_global.WheelRail = function(__mcRef)
{
this.mcRef = __mcRef;
this.nSlowFactor = 1;
this.nAngle = 0;
this.nDistanceMade = 0;
this.nDirection = WheelRail.DIRECTION_LEFT;
this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
this.bSearchingForAffectation = true;
this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
Level.__get__Instance().doAddListener(this);
}.DECEL_ON_EDGES = 0.08;
_global.WheelRail = function(__mcRef)
{
this.mcRef = __mcRef;
this.nSlowFactor = 1;
this.nAngle = 0;
this.nDistanceMade = 0;
this.nDirection = WheelRail.DIRECTION_LEFT;
this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
this.bSearchingForAffectation = true;
this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
Level.__get__Instance().doAddListener(this);
}.MAX_SLOW_FACTOR = 0.1;
§§push(ASSetPropFlags(_global.WheelRail.prototype,null,1));
}
§§pop();
break;
}
if(eval("\x01") == 948)
{
set("\x01",eval("\x01") - 80);
}
else if(eval("\x01") == 285)
{
set("\x01",eval("\x01") + 389);
if(§§pop())
{
set("\x01",eval("\x01") + 274);
}
}
else if(eval("\x01") == 338)
{
set("\x01",eval("\x01") + 72);
}
else if(eval("\x01") == 51)
{
set("\x01",eval("\x01") + 483);
§§push(true);
}
else
{
if(eval("\x01") == 674)
{
set("\x01",eval("\x01") + 274);
break;
}
if(eval("\x01") == 559)
{
set("\x01",eval("\x01") + 309);
}
else if(eval("\x01") == 726)
{
set("\x01",eval("\x01") - 316);
}
else if(eval("\x01") == 868)
{
set("\x01",eval("\x01") - 517);
§§push(true);
}
else
{
if(eval("\x01") == 823)
{
set("\x01",eval("\x01") - 823);
break;
}
if(eval("\x01") == 199)
{
set("\x01",eval("\x01") + 527);
break;
}
if(eval("\x01") == 351)
{
set("\x01",eval("\x01") + 547);
if(§§pop())
{
set("\x01",eval("\x01") - 65);
}
}
else if(eval("\x01") == 534)
{
set("\x01",eval("\x01") - 335);
if(§§pop())
{
set("\x01",eval("\x01") + 527);
}
}
else
{
if(eval("\x01") == 898)
{
set("\x01",eval("\x01") - 65);
break;
}
if(eval("\x01") != 833)
{
break;
}
set("\x01",eval("\x01") - 782);
}
}
}
}
}